#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QWidget>
#include <QSet>
#include <QString>

namespace Ui {
class MainWindow;
}

class QNetworkReply;
class QTimer;
class QNetworkAccessManager;


class MainWindow : public QWidget
{
    Q_OBJECT
    
public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();
private:
    Ui::MainWindow *ui;
    int last_time;
    int slow_speed, fast_speed;
    bool locked;
    bool running;
    QTimer *update_timer;
    QString stream_id;
    QNetworkAccessManager *manager;
    QSet<QString> lastMessages;

    void closeEvent(QCloseEvent *event);
    void readSettings();
    void saveSettings();

private slots:
    void replyFinished(QNetworkReply *reply);
    void on_update_clicked();
    void updateMessages();
    void on_fastmode_toggled(bool checked);

    void on_fixwindow_toggled(bool checked);
    void on_settings_clicked();
    void on_saveSettings_clicked();
};

#endif // MAINWINDOW_H
